home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-11 | 3.2 KB | 121 lines | [TEXT/MPS ] |
- /*
- File: SESettingsExtension.cpp
-
- Contains: SoundEditor Settings Extension class implementation
-
- Written by: Steve Smith
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- */
-
-
- // -- Compiler/Preprocessor Switches --
-
- #ifndef _COMPILERDEFS_
- #include "CompDefs.h"
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef _EXCEPT_
- // Exceptions define several important macros (eg. CHECKENV)
- // which are used in the SOM method dispatch glue. If Except.h
- // is not included early enough, exceptions may not be thrown
- // correctly when returning from a SOM method with the "ev" parameter set.
- #include <Except.h>
- #endif
-
- // -- SoundEditor Includes --
-
- #ifndef _SESETTINGSEXTENSION_
- #include "SESettingsExtension.h"
- #endif
-
- #ifndef _SOUNDEDITOR_
- #include "SoundEditor.h"
- #endif
-
- #ifndef SOM_SampleCode_som_SoundEditor_xh
- #include "som_SoundEditor.xh"
- #endif
-
- // -- OpenDoc Includes --
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
-
- #pragma segment SESettingsExtension
-
- //==============================================================================
- // SESettingsExtension
- //==============================================================================
-
- //------------------------------------------------------------------------------
- // Method: Constructor
- //
- // Description:
- //------------------------------------------------------------------------------
-
- SESettingsExtension::SESettingsExtension()
- {
- SOM_Trace("SESettingsExtension","SESettingsExtension");
-
- fOwner = kODNULL;
- }
-
- //------------------------------------------------------------------------------
- // Method: Destructor
- //
- // Description:
- //------------------------------------------------------------------------------
-
- SESettingsExtension::~SESettingsExtension()
- {
- SOM_Trace("SESettingsExtension","somUninit");
- }
-
- //------------------------------------------------------------------------------
- // Method: InitSettingsExtension
- //
- // Description:
- //------------------------------------------------------------------------------
-
- void SESettingsExtension::InitSettingsExtension( Environment* ev,
- ODPart* owner )
- {
- SOM_Trace("SESettingsExtension","InitSettingsExtension");
-
- // Here we get the real part, which means that we get the actual ODPart
- // that the part wrapper points to. We know that this will be an
- // object of the SampleCode_som_SoundEditor class, so we cast it thusly.
- // From this object, we use our GetImplementation function, which
- // returns a pointer to our wrapped C++ object so that we can call it
- // directly. This is safe because the extension and the part will be in
- // the same address space and machine.
- fOwner = ((SampleCode_som_SoundEditor*) owner->GetRealPart(ev))
- ->GetImplementation(ev);
-
- owner->ReleaseRealPart(ev);
- }
-
- //------------------------------------------------------------------------------
- // Method: ShowSettings
- //
- // Description:
- //------------------------------------------------------------------------------
-
- void SESettingsExtension::ShowSettings( Environment* ev,
- ODFacet* facet )
- {
- SOM_Trace("SESettingsExtension","ShowSettings");
-
- fOwner->ShowSettingsDialog(ev, facet->GetFrame(ev));
- }
-
-